08. Interpolation

Heading

Interpolation

ND320 C4 L1 08 Resampling - Interpolation

Resampling & Interpolation Summary

We just learned about interpolation which is a technique that allows us to work with multiple signals that are sampled differently in time. We saw 2 signals that are both 1 Hz sine waves, but the one that is sampled at 60 Hz has many more data points than the one sampled at 25 Hz. After plotting and verifying the lengths of the signals, it might appear that s2_interp and s1 are the same, but it is most certainly not! By plotting the original and the interpolated signal together we can see that linear interpolation estimates points in between existing points by using a weighted average of the original points.

ND320 C4 L1 09 Non-Uniform Sampling

Resampling / Interpolation recap

Previously we had only discussed uniformly sampled signals where the signal is sampled at fixed intervals in time, but sometimes we may encounter signals that are sampled haphazardly in time. This is troubling because a lot of signal processing techniques that we are about to learn require that the signal is sampled uniformly. We can fix this again with linear interpolation. When we compare the 2 signals, one uniformly and one not uniformly sampled, we can see that they follow the same continuous signal but the location of those samples are at different times. Using the np.interp function you can recover the signal in which the now non-uniformly sampled signal will have a signal point like the uniform signal. But you may notice artifacts at the edge of the resampled signal, and there is more error when the gap between existing samples is larger.

Notebook Review

If you wanted to interact with the notebook in the video, you can access it here in the repo intro-to-dsp/walkthroughs/interpolation/ or in the workspace below.

Code

If you need a code on the https://github.com/udacity.